﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data.Odbc;
using System.Data.OleDb;
using System.Configuration;


public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request.QueryString["GottextBoxName"]))
        {
            string PrevioustxtboxName = Request.QueryString["GottextBoxName"];
            //LabelName.Text = PrevioustxtboxName; 

            String CS = ConfigurationManager.ConnectionStrings["myDBConnection"].ConnectionString;
            using (SqlConnection myConnection = new SqlConnection(CS))
            {
                
                myConnection.Open();

                string RetriveuserID = "select userId from customer_new where name = '" + PrevioustxtboxName + "'";
                SqlCommand command = new SqlCommand(RetriveuserID, myConnection);
                string gotDetail = command.ExecuteScalar().ToString();
                myConnection.Close();

                LabelUserID.Text = gotDetail;
                
            }

        }
    }
    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
}